<?php
//Will extends sfThemePluin to module template

/**
 * Description of sfThemeView
 *
 * @author Bartpab
 */
class sfThemeView extends sfPHPView {
    public function configure(){
        parent::configure();
        $theme = $this->context->getUser()->getCurrentTheme();
        if($theme && sfConfig::get('app_theme_enabled', false)){
            if(is_readable($this->getDirectory().'/'.$theme.'/'.$this->getTemplate())){
                 $this->setDirectory($this->getDirectory().'/'.$theme);
            }
            if (is_readable($this->getDecoratorDirectory().'/'.$theme.'/'.$this->getDecoratorTemplate()))
            {
                $this->setDecoratorDirectory($this->getDecoratorDirectory().'/'.$theme);
            }
        }
    }
}
?>
